<template>
<div class="bh-badge" :class="[typeClass]">
	<slot></slot>
	<sup
		v-text="content"
		class="bh-badge__content">
	</sup>
</div>
</template>

<script>
export default {
	name: 'bh-badge',
	props: {
		value: [String, Number],
		type: {
			type: String,
			default: 'default',
			validator(val) {
				return ['default', 'primary', 'success', 'warning', 'info', 'danger'].indexOf(val) > -1;
			}
		}
	},
	data() {
		return {
			visible: true,
		}
	},
	methods: {
		close() {
			this.visible = false;
			this.$emit('close');
		},
	},
	computed: {
		content() {
			return `${ this.value }`;
		},
		typeClass() {
			return `bh-badge--${ this.type }`;
		},
	},
}
</script>
